﻿
namespace AzureStorageMapper.Criterias.TableStorage
{
    public class Restrietion : AbstractQuery
    {
        private Criteria _criteriaOne;
        private Criteria _criteriaTwo;
        private string _relation;

        #region Properties
        public Criteria CriteriaOne
        {
            get { return this._criteriaOne; }
        }

        public Criteria CriteriaTwo
        {
            get { return this._criteriaTwo; }
        }

        public string Relation
        {
            get { return this._relation; }
        }
        #endregion

        public Restrietion()
        {
            this._criteriaOne = null;
            this._criteriaTwo = null;
            this._relation = null;
        }

        public void And(Criteria one, Criteria two)
        {
            this._criteriaOne = one;
            this._criteriaTwo = two;
            this._relation = "and";
        }

        public void Not(Criteria criteria)
        {
            this._criteriaOne = criteria;
            this._criteriaTwo = null;
            this._relation = "not";
        }

        public void Or(Criteria one, Criteria two)
        {
            this._criteriaOne = one;
            this._criteriaTwo = two;
            this._relation = "or";
        }
    }
}
